﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class UnityEngineAnimationsMuscleHandleWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(UnityEngine.Animations.MuscleHandle);
			Utils.BeginObjectRegister(type, L, translator, 0, 0, 3, 0);
			
			
			
			Utils.RegisterFunc(L, Utils.GETTER_IDX, "humanPartDof", _g_get_humanPartDof);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "dof", _g_get_dof);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "name", _g_get_name);
            
			
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 2, 1, 0);
			Utils.RegisterFunc(L, Utils.CLS_IDX, "GetMuscleHandles", _m_GetMuscleHandles_xlua_st_);
            
			
            
			Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "muscleHandleCount", _g_get_muscleHandleCount);
            
			
			
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 2 && translator.Assignable<UnityEngine.BodyDof>(L, 2))
				{
					UnityEngine.BodyDof _bodyDof;translator.Get(L, 2, out _bodyDof);
					
					var gen_ret = new UnityEngine.Animations.MuscleHandle(_bodyDof);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				if(LuaAPI.lua_gettop(L) == 2 && translator.Assignable<UnityEngine.HeadDof>(L, 2))
				{
					UnityEngine.HeadDof _headDof;translator.Get(L, 2, out _headDof);
					
					var gen_ret = new UnityEngine.Animations.MuscleHandle(_headDof);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				if(LuaAPI.lua_gettop(L) == 3 && translator.Assignable<UnityEngine.HumanPartDof>(L, 2) && translator.Assignable<UnityEngine.LegDof>(L, 3))
				{
					UnityEngine.HumanPartDof _partDof;translator.Get(L, 2, out _partDof);
					UnityEngine.LegDof _legDof;translator.Get(L, 3, out _legDof);
					
					var gen_ret = new UnityEngine.Animations.MuscleHandle(_partDof, _legDof);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				if(LuaAPI.lua_gettop(L) == 3 && translator.Assignable<UnityEngine.HumanPartDof>(L, 2) && translator.Assignable<UnityEngine.ArmDof>(L, 3))
				{
					UnityEngine.HumanPartDof _partDof;translator.Get(L, 2, out _partDof);
					UnityEngine.ArmDof _armDof;translator.Get(L, 3, out _armDof);
					
					var gen_ret = new UnityEngine.Animations.MuscleHandle(_partDof, _armDof);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				if(LuaAPI.lua_gettop(L) == 3 && translator.Assignable<UnityEngine.HumanPartDof>(L, 2) && translator.Assignable<UnityEngine.FingerDof>(L, 3))
				{
					UnityEngine.HumanPartDof _partDof;translator.Get(L, 2, out _partDof);
					UnityEngine.FingerDof _fingerDof;translator.Get(L, 3, out _fingerDof);
					
					var gen_ret = new UnityEngine.Animations.MuscleHandle(_partDof, _fingerDof);
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
				if (LuaAPI.lua_gettop(L) == 1)
				{
				    translator.Push(L, default(UnityEngine.Animations.MuscleHandle));
			        return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
			}
            return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Animations.MuscleHandle constructor!");
            
        }
        
		
        
		
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetMuscleHandles_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    UnityEngine.Animations.MuscleHandle[] _muscleHandles = (UnityEngine.Animations.MuscleHandle[])translator.GetObject(L, 1, typeof(UnityEngine.Animations.MuscleHandle[]));
                    
                    UnityEngine.Animations.MuscleHandle.GetMuscleHandles( _muscleHandles );
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_humanPartDof(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.Animations.MuscleHandle gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
                translator.PushUnityEngineHumanPartDof(L, gen_to_be_invoked.humanPartDof);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_dof(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.Animations.MuscleHandle gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.dof);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_name(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.Animations.MuscleHandle gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked);
                LuaAPI.lua_pushstring(L, gen_to_be_invoked.name);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_muscleHandleCount(RealStatePtr L)
        {
		    try {
            
			    LuaAPI.xlua_pushinteger(L, UnityEngine.Animations.MuscleHandle.muscleHandleCount);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        
        
		
		
		
		
    }
}
